gtkbuilderparser: Add some assertions
authorMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 19:52:22 +0000 (15:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Jul 2015 20:11:16 +0000 (16:11 -0400)
Add some assertions that things are non-NULL when we know they
are, so that coverity gets it.

gtk/gtkbuilderparser.c

index 160c7bcdb5e48b4f2cf8f1129d8fea6b45877947..9153f1515cc8b950d03d02195b171c910360cd49 100644 (file)
@@ -1141,6 +1141,8 @@ end_element (GMarkupParseContext  *context,
       PropertyInfo *prop_info = state_pop_info (data, PropertyInfo);
       CommonInfo *info = state_peek_info (data, CommonInfo);
 
+      g_assert (info != NULL);
+
       /* Normal properties */
       if (strcmp (info->tag.name, "object") == 0 ||
           strcmp (info->tag.name, "template") == 0)
@@ -1176,6 +1178,7 @@ end_element (GMarkupParseContext  *context,
     {
       SignalInfo *signal_info = state_pop_info (data, SignalInfo);
       ObjectInfo *object_info = (ObjectInfo*)state_peek_info (data, CommonInfo);
+      g_assert (object_info != NULL);
       signal_info->object_name = g_strdup (object_info->id);
       object_info->signals = g_slist_prepend (object_info->signals, signal_info);
     }